//
//  MyButton.m
//  UIA段项目 墨家天气
//
//  Created by dllo on 15/8/20.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MyButton.h"

@implementation MyButton
-(void)dealloc{
   
    [_weak release];
    [_weather release];
    [_highTemp release];
    [_lowTemp release];
    [_yunImage release];
    [_score release];
    [_yunLabel release];
    [_highDu release];
    [_lowDu release];
     [super dealloc];
    
}
- (instancetype)initWithFrame:(CGRect)frame
{
    
    
    self =[super initWithFrame:frame];
    if (self) {
        
        self.weak = [[UILabel alloc]init];
        self.weak.textColor = [UIColor whiteColor];
        self.weak.font = [UIFont systemFontOfSize:15 * OffWidth];
        
        [self addSubview:_weak];
        [_weak release];
        
        self.weather = [[UILabel alloc]init];
        self.weather.textColor = [UIColor whiteColor];
        self.weather.font = [UIFont systemFontOfSize:15  * OffWidth];
        self.weather.textAlignment = 1;
        [self addSubview:_weather];
        [_weather release];
        
        
        self.highTemp = [[UILabel alloc]init];
        self.highTemp.textColor = [UIColor whiteColor];
        self.highTemp.font = [UIFont systemFontOfSize:17 * OffWidth];
        self.highTemp.font = [UIFont fontWithName:@"AllHookedUp" size:17 * OffWidth];

        [self addSubview:_highTemp];
        [_highTemp release];
        
        
        
        self.lowTemp = [[UILabel alloc]init];
        self.lowTemp.textColor = [UIColor whiteColor];
        self.lowTemp.font = [UIFont systemFontOfSize:15 * OffWidth];
        self.lowTemp.font = [UIFont fontWithName:@"AllHookedUp" size:15 * OffWidth];

        [self addSubview:_lowTemp];
        [_lowTemp release];
        
        
        self.yunImage = [[UIImageView alloc]init];
        self.yunImage.backgroundColor = [UIColor clearColor];
        [self addSubview:_yunImage];
        [_yunImage release];

        
        self.score = [[UILabel alloc]init];
        self.score.layer.cornerRadius = 5;
        self.score.font = [UIFont systemFontOfSize:13 * OffWidth];
        self.score.textAlignment = 1;
        self.score.layer.masksToBounds = YES;
        [self addSubview:_score];
        [_score release];
        
        self.highDu = [[UILabel alloc]init];
        self.highDu.textColor = [UIColor whiteColor];
        
        [self addSubview:_highDu];
        
        self.lowDu = [[UILabel alloc]init];
        self.lowDu.textColor = [UIColor whiteColor];
        [self addSubview:_lowDu];
    }
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    self.weak.frame = CGRectMake(20 * OffWidth, 10 * OffHeight, 50 * OffWidth, 20 * OffHeight);
    self.yunImage.frame = CGRectMake(25 * OffWidth, 40 * OffHeight, 25 * OffWidth, 25 * OffHeight);
    self.weather.frame = CGRectMake(0, 65 * OffWidth, self.frame.size.width, 30 * OffHeight);
    self.score.frame = CGRectMake(60 * OffWidth, 12 * OffHeight, 35 * OffWidth, 15 * OffHeight);
    self.highTemp.frame = CGRectMake(70 * OffWidth, 30 * OffHeight, 70 * OffWidth, 20 * OffHeight);
    self.highDu.frame = CGRectMake(88 * OffWidth, 20 * OffHeight, 70 * OffWidth, 20 * OffHeight);
    self.lowTemp.frame = CGRectMake(70 * OffWidth, 50 * OffHeight, 50 * OffWidth, 20 * OffHeight);
    self.lowDu.frame =  CGRectMake(88 * OffWidth, 40 * OffHeight, 50 * OffWidth, 20 * OffHeight);

    
}
@end
